using System.Collections.Generic;

namespace Is
{
    public sealed class ContainsDictionary<TKey, TValue> : ContainsEnumerableBase<KeyValuePair<TKey, TValue>, ContainsDictionary<TKey, TValue>>
    {
        internal ContainsDictionary(IEnumerable<KeyValuePair<TKey, TValue>> target, bool negate) : base(target, negate) { }

        public bool Key(TKey key)
        {
            if (negate)
            {
                return Core.Is.NotContains(target, x => x.Key.Equals(key));
            }
            else
            {
                return Core.Is.Contains(target, x => x.Key.Equals(key));
            }
        }
    }
}